package cn.openea.perpartner.meily.web.mapper;

import cn.openea.perpartner.meily.web.entity.CourseCategory;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * 课程分类
 *
 * @author ysk
 * @email zane_ysk@qq.com
 */
@Mapper
public interface CourseCategoryMapper extends BaseMapper<CourseCategory> {

    /**
     * 判断同一个父类别下面是否存在相同的数据
     */
    @Select("SELECT 1 FROM meily_course_category WHERE parent_id = #{parentId} and name = #{name}")
    Integer existenceDataByParentId(@Param("parentId") Long parentId,@Param("name") String name);
}
